<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">

<ui:composition template="/templates/template.xhtml">
	<ui:define name="body">
	<f:view>
		<h:messages layout="table" />
		<h:form>
			<h:panelGrid columns="2">
				<h:outputText value="name:"></h:outputText>
				<h:inputText value="#{userBean.user.login}" />

				<h:outputText value="email:" />
				<h:inputText value="#{userBean.user.email}" />

				<h:outputText value="password:" />
				<h:inputSecret value="#{userBean.user.password}" />


			</h:panelGrid>
			<h:commandButton value="Submit" action="#{userBean.add}" />
			<h:commandButton value="Pesquisar" action="#{userBean.pesquisar}" />

			<h:panelGrid>
				<rich:dataTable id="dataTable" value="#{userBean.listaUsuarios}"
					var="user">
					<rich:column>
						<f:facet name="nome"></f:facet>
						<h:outputText value="#{user.login}" />
					</rich:column>
					<rich:column>
						<f:facet name="nome"></f:facet>
						<h:outputText value="#{user.password}" />
					</rich:column>
					<rich:column>
						<f:facet name="nome"></f:facet>
						<h:outputText value="#{user.email}" />
					</rich:column>
				</rich:dataTable>
			</h:panelGrid>
		</h:form>
	</f:view>
	<h:outputLink value="#{request.contextPath}/j_spring_security_logout">Logout</h:outputLink>
	</ui:define>
</ui:composition>


</html>